/*
理解形参和实例参数化，fun函数的两个形参类型是固定的
function fun(name: string, age: number): void {
    console.log(name,age)
}
*/
function foo(arg) {
    return arg;
}
/* 泛型的完整写法 */
var res1 = foo(100);
console.log(res1.toFixed(3));
var res2 = foo("陶品奇");
console.log(res2.length);
var res3 = foo({ name: "马云", age: 22 });
console.log(res3.name, res3.age);
/* 泛型的省略写法 */
var res4 = foo("123456");
var res5 = foo("哈哈哈");
console.log(res4, res5);
